Born in Orange County, Virginia, Zachary Taylor joined the army in 1808 and served as an officer under William Henry Harrison during the War of 1812. For 21 years he served in forts along the western frontier. After being promoted to general, Taylor commanded U.S. troops in Texas. In 1845 he was ordered to defend the newly annexed state against a possible invasion by the Mexican army. He led the U.S. Army of the Rio Grande and captured the Mexican city of Monterrey in 1846. Taylor ended the war in northern Mexico by defeating General Antonio López de Santa Anna at the Battle of Buena Vista in 1847. After achieving fame as a war hero, Taylor earned the nickname “Old Rough and Ready.” In 1848 Taylor won the presidency after running on the Whig Party ticket. While in office, however, he became seriously ill and died in 1850, only a few days after attending an Independence Day celebration.